let data = JSON.parse(localStorage.getItem('cart')) || []
let count=document.querySelector('.count')
let money=document.querySelector('.money')
let ul=document.querySelector('ul')
let sum=0,price=0
data.forEach(item=>{
  if(item.is_select===true){
    sum+=item.cart_number
    price+=item.price*item.cart_number-0
  }
})
count.innerHTML=sum
money.innerHTML='￥'+price+'元'


let btn=document.querySelector('.erweima')
let max=document.querySelector('.max')
let min=document.querySelector('.min')
let xx=document.querySelector('.xx')
let inp=document.querySelectorAll('input')
btn.onclick=()=>{
  if(!inp[0].checked){
      if(!inp[1].checked){
        if(!inp[2].checked){
          if(!inp[3].checked){
            alert('请选择支付项')
            return false
          }
        }
      }
    }
  btn.style.display='none'
    max.style.display='block'
    min.style.display='block'
}
xx.onclick=()=>{
  btn.style.display='block'
  max.style.display='none'
  min.style.display='none'
}


